import { RouteConfig } from "vue-router";
import Layout from "@/layout/index.vue";

const workOrderRouter: RouteConfig = {
  path: "/workorder",
  component: Layout,
  redirect: "/workorder/pending",
  name: "WorkOrderManage",
  meta: {
    title: "workOrderManage",
    icon: "iconfont icon-userstoryicon",
    routerRuleName: "WorkOrderManage"
  },
  children: [
    {
      path: "pending",
      component: () => import("@/views/work-order/pending.vue"),
      name: "PendingWorkOrder",
      meta: {
        title: "pendingWorkOrder",
        noCache: true,
        routerRuleName: "PendingWorkOrder"
      }
    },
    {
      path: "processed",
      component: () => import("@/views/work-order/processed.vue"),
      name: "ProcessedWorkOrder",
      meta: {
        title: "processedWorkOrder",
        noCache: true,
        routerRuleName: "ProcessedWorkOrder"
      }
    },
    {
      path: "reported",
      component: () => import("@/views/work-order/reported.vue"),
      name: "ReportedWorkOrder",
      meta: {
        title: "reportedWorkOrder",
        noCache: true,
        authrole: 'tenant_admin'
      }
    }
  ]
};

export default workOrderRouter;
